package responsibilitychain.example;

/**
 * @author Chen Guang
 * @date 2019/4/23 0023 上午 10:17
 */
public class CommonManager extends Manager{

    private String name;

    public CommonManager(String name) {
        super(name);
        this.name = name;
    }

    @Override
    public void requestApplications(Request request) {
        if("请假".equals(request.getRequestType()) && request.getNumber() <= 2){
            System.out.println(this.name + " :" + request.getRequestContent() + " 数量 " + request.getNumber() + " 被批准");
        }else {
            if(super.getSuperior() != null){
                super.getSuperior().requestApplications(request);
            }
        }
    }
}
